package com.chenfan.filestore.config;

import java.util.ArrayList;
import java.util.List;

/**
 *  动态数据源上线文
 * @author leo
 */
public class DynamicDataSourceContextHolder {

    private static final ThreadLocal<String> contextHolder = new InheritableThreadLocal<>();

    public static List<String> DS_KEYS = new ArrayList<String>();

    public static String get() {
        return contextHolder.get();
    }

    public static void set(String dataSourceType) {
        contextHolder.set(dataSourceType);
    }

    public static void clear() {
        contextHolder.remove();
    }

}
